<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
<!--    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>-->
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="d1">
        <p>{{msg}}</p>
        <button @click="msg='modify'">修改</button>
        <button @click="destroy()">销毁</button>
    </div>
    <script>

        new Vue({
            el: "#d1",
            data:{
                msg:"Hello"
            },
            methods:{
                destroy(){
                    this.$destroy();
                }
            },
            computed:{
            },
            beforeCreate(){
                console.log("创建前")
            },
            created(){
                console.log("创建后")
            },
            beforeMount(){
                console.log("挂载前");
            },
            mounted(){
                console.log("挂载后");
            },
            beforeUpdate(){
                console.log("修改前");
            },
            updated(){
                console.log("修改后");
            },
            beforeDestroy(){
                console.log("销毁前");
            },
            destroyed(){
                console.log("销毁后");
            }
        });
    </script>
</body>
</html>